import React from "react";
import Drone from "../Drone";
import NewDrone from "../NewDrone";
import {Radio } from "antd";
import MessageUtil from "../../../../../utils/MessageUtil";
import NoneDrone from "../NoneDrone";

export default class extends React.Component{
    
    constructor(props){
        super();
        this.state={
            newDrone:true,
            showNoneDrone:false, //是否显示无飞行器
        }
    }
    Change(value){
        this.setState({
            newDrone:value===2
        },()=>{
            MessageUtil.ChangeHeight();
        });
    }
    render(){
        return(
            <div className="" >
                <div style={{display:this.state.showNoneDrone?"":"none"}}>
                    <NoneDrone/>
                </div>
                <div className="Publish_SecondHand_Title" 
                 style={{display:!this.state.showNoneDrone?"":"none"}}>
                    <div className="TradePublishType_RadioBox">
                        <Radio.Group name="radiogroup" defaultValue={2} onChange={e=>this.Change(e.target.value)}>
                            <Radio value={1} disabled={true}>发布已认证的飞行棋</Radio>
                            <Radio value={2} >发布新产品</Radio>
                        </Radio.Group>
                    </div>
                   <div>
                       {this.state.newDrone?<NewDrone/>:<Drone/>}
                    </div>
                </div>
            </div>
        )
    }
}